<template>
	<view :class="lang">
		<u-navbar :is-fixed="true" :title="title" back-icon-name="arrow-leftward">
			<view class="slot-wrap greenbg heigh150">
				<view class="u-navbar-centent-slot"><!-- <text>购卡中心</text> --></view>
			</view>
		</u-navbar>
		<view class="video">
			<view class="subject-video-layout" v-if="videolist.length > 0">
				<videoitems
					v-if="videolist.length > 0"
					v-for="(item, index) in videolist"
					:key="index"
					:lang="lang"
					backurl="relevant"
					:ids="item.vid"
					:pic="item.imgurl"
					:title="item.name"
					:count="item.bofangcount"
					:itemlist="item"
				></videoitems>
			</view>
			<view style="text-align: center; height: 500rpx; line-height: 300rpx;" v-if="videolist.length == 0">
				暂无视频
			</view>
			<!-- <view class="subject-video-layout">
				<videoitems v-for="(item, index) in videolist" :key="index" :lang="lang" :ids="item.videoid" :pic="item.pic" :title="item.title" :count="item.count"></videoitems>
			</view> -->
		</view>
	</view>
</template>

<script>
	import videoitems from '@/components/videoitem/videoitem.vue';
	import {
		//wxlogin_api, //微信登陆接口
		//applelogin_api, //苹果一键登录接口
		videolist_api		//视频列表接口

	} from '@/api/index';
	export default {
		components:{
					videoitems		//视频模块
		        },
		data() {
			return {
				lang: this.$i18n.locale,
				title: this.$t('mediatxt.相关视频'),
				videolist:[]
			}
		},
		onLoad() {
			var that = this;
			that.videolists();
			
		},
		methods: {
			videolists: function() {
				var that = this;
				console.log('jinru video list');
				that.https({
					url: videolist_api,
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					data: {
						type: 2,
						lang:that.lang
					},
					success: res => {
						console.log(res);
						that.videolist = res.kemu;
						// that.kemu3videolist = res.kemu3;
					},
					fail: err => {
						console.log(err);
					}
				});
			},
		}
	}
</script>

<style>
.video{
	width: 700rpx;
	margin: 0 auto;
	padding-top: 20rpx;
}
/* 视频模块 */
	.subject-video-layout{
		width: 680rpx;
		display: flex;
		justify-content: space-between;
		flex-flow: row wrap;
	}
</style>
